This file cannot be accessed directly.
'); } if (!isset($stored_config, $config_generator)) //make sure variables in index.php are set { die('Error: Filenames not defined. Check index.php to make sure $stored_config and $config_generator are set.
'); } if (count($_POST) == 38) { $final_output = " $current) { $current = str_replace('\'', '\\\'', str_replace('\\', '/', trim($current))); switch ($key) { case 'base_dir': if ($current == '') { die('Error: Make sure $base_dir has been assigned a value.
'); } if (!preg_match('#/$#', $current)) //make sure there is a slash at the end of base_dir { $current .= '/'; } if (!@is_dir($current)) { die('Error: $base_dir is not a valid directory.
'); } $final_output .= "\n/* Required settings: */\n\n\$$key = '$current';\n"; break; case 'icon_path': while (preg_match('#/$#', $current)) //make sure there is not a slash at the end { $current = substr($current, 0, -1); } case 'stylesheet': case 'user_list': case 'log_file': case 'download_count': case 'links_file': case 'description_file': case 'index': case 'header': case 'footer': case 'path_to_language_files': case 'lang': case 'banned_list': //strings $final_output .= "\$$key = '$current';\n"; break; case 'use_login_system': $final_output .= "\n\n/* Optional settings: */\n\n"; case 'allow_uploads': case 'must_login_to_download': case 'allow_file_overwrites': case 'sub_folder_access': case 'force_download': case 'anti_leech': case 'enable_searching': case 'show_dir_size': case 'folder_expansion': case 'show_folder_count': case 'header_per_folder': case 'footer_per_folder': case 'show_type_column': case 'show_size_column': case 'show_date_column': case 'select_language': //booleans if ($current != 'true' && $current != 'false') { die('$'.htmlentities($key).' must be set to "true" or "false".
'); } $final_output .= "\$$key = $current;\n"; break; case 'thumbnail_height': case 'bandwidth_limit': case 'days_new': case 'md5_show': //numbers $current = (string)((float)$current); $final_output .= "\$$key = $current;\n"; break; case 'dont_log_these_ips': case 'hidden_files': case 'show_only_these_files': //arrays if ($current == '') { $temp = 'array();'; } else { $temp = 'array('; foreach (explode(',', $current) as $a) { $a = trim($a); if ($a != '') { $temp .= "\n\t\"$a\","; } } $temp = substr($temp, 0, -1) . ');'; } $final_output .= "\$$key = $temp\n"; break; default: die('$'.htmlentities($key).' is not a valid configuration setting.
'); } } $final_output .= "\n?>"; $_POST['base_dir'] = str_replace('\\', '/', trim($_POST['base_dir'])); if ((preg_match('#^(/|[a-z]\:)#i', $_POST['base_dir']) || $_POST['bandwidth_limit'] != '0') && $_POST['force_download'] == 'false') { die('Error: It seems you\'re using an absolute path for the base_dir, or bandwidth_limit is being used.
This requires that you have force_download turned on.
You must set force_download to "true" so files can be downloaded. Otherwise, use a relative path instead of an absolute path or turn off bandwidth_limit.
'); } if ($_POST['use_login_system'] == 'true' && !@is_file(trim($_POST['user_list']))) { die('Error: Could not open the $user_list file.
Set $user_list to the correct file, or turn off the login system.
Error: You must use icons for the folder_expansion feature to work.
Set icon_path to the path where the icons can be found.